package org.thanos.demo.service.role;

import org.apache.shiro.lang.util.Assert;
import org.springframework.stereotype.Service;
import org.thanos.demo.entity.SysRole;

import java.util.Objects;

@Service("sysRoleService")
public class SysRoleServiceImpl implements SysRoleService {

    @Override
    public SysRole selectById(Integer roleId) {
        Assert.isTrue(Objects.nonNull(roleId));
        return SysRole.data().stream().filter(sysRole -> sysRole.getId().equals(roleId)).findAny().orElse(null);
    }
}
